diff options
Diffstat (limited to 'src/routes/(app)/[username]/update')
| -rw-r--r-- | src/routes/(app)/[username]/update/+server.js | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/routes/(app)/[username]/update/+server.js b/src/routes/(app)/[username]/update/+server.js new file mode 100644 index 00000000..3e3a9358 --- /dev/null +++ b/src/routes/(app)/[username]/update/+server.js @@ -0,0 +1,11 @@ +import { auth, post } from "$lib/utils"; +import { error, json } from "@sveltejs/kit"; + +export async function POST({ cookies, request }) { + try { + let body = await request.json(); + return json(await post(`/user`, body, auth(cookies))); + } catch (e) { + error(500, e.message); + } +} |
